	<!DOCTYPE html>
	<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
		<style>
			*{
				margin: 0;
				padding: 0;
			}
			#box{
				width: 500px;
				height: 500px;
				border: 1px solid #000;
				margin:  20px auto;
				overflow-y: scroll;
			}
			#box #left,#box #right{
				width: 100%;
				height: 50px;
			}
			#box #left img,#box #left span{
				float: left;
				line-height: 50px;
				font-size: 18px;
				font-weight: bold;
			}
			#box #right img,#box #right span{
				float: right;
				line-height: 50px;
				font-size: 18px;
				font-weight: bold;
			}
			#box #left .contentL{
				margin-left: 10px;
				font-size: 16px;
				font-weight: 300;
			}
			#box #right .contentR{
				margin-right: 10px;
				font-size: 16px;
				font-weight: 300;
			}
			#div{
				width: 500px;
				margin: 0 auto;
				
			}
		</style>
	</head>
	<body>
		<div id="box">
			<!-- <div id="left">
				<img src="./img/boy.png" alt="">
				<span>王丝</span>
				<span class="contentL">123</span>
			</div>
			<div id="right">
				<img src="./img/girl.png" alt="">
				<span>菊鹅</span>
				<span class="contentR">123</span>
			</div> -->
		</div>
		<div id="div">
			<img src="./img/boy.png" alt="" id="img">
			<span id="ws">王丝</span>
			<input type="text" id="inp">
			<button id="sub">提交</button>
		</div>
		
		
	</body>
		<script>
			var img = document.getElementById("img");
			var ws = document.getElementById("ws");
			var inp = document.getElementById("inp");
			var sub = document.getElementById("sub");
			var box = document.getElementById("box");
			img.onclick = function(){
				if(ws.innerHTML == '王丝'){
					img.src = "./img/girl.png";
					ws.innerHTML = "菊鹅";
					
				}else{
					img.src = "./img/boy.png";
					ws.innerHTML = "王丝";
				}
				
			}
			ws.onclick = function(){
				if(ws.innerHTML == '王丝'){
					img.src = "./img/girl.png";
					ws.innerHTML = "菊鹅";
					
				}else{
					img.src = "./img/boy.png";
					ws.innerHTML = "王丝";
				}
				
			}
			sub.onclick = function(){
				var val = inp.value;
				if(ws.innerHTML == '王丝'){
					box.innerHTML += "<div id='left'><img src='./img/boy.png' alt=''><span>王丝</span><span class='contentL'>"+ val +"</span></div>";
					
				}else{
					box.innerHTML +="<div id='right'><img src='./img/girl.png' alt =''><span>菊鹅</span><span class='contentR'>" + val +"</span></div>";
				}
				inp.value = "";
			}
			
			
			
			
		</script>
	</html>